(function(K) {

K.classLoader().
includes("tk.k90tools.lang.Reflect").
includes("tk.k90tools.K").
provides("tk.k90tools.lang.Object").
load(function(I) {
	var OP = Object.prototype;
	var Obj;
	
	return Obj = {
		prototypeOf : function(o) {
			if (!I.Reflect.isObject(o)) {
				throw new TypeError();
			}
			
			return o.constructor.prototype;
		},
		
		ownKeys : function(o) {
            if (!I.Reflect.isObject(o)) {
                throw new TypeError();
            }
            
            var properties = [];
            for (var p in o) if (OP.hasOwnProperty.call(o, p)) {
        		properties.push(p);
            }
            
            return properties;
		},
		
		create : function(o, properties) {
            if (!I.Reflect.isObject(o)) {
                throw new TypeError();
            }			
			
			var c = function() {};
			c.prototype = o;
			
			var instance = new c();
			instance.constructor = Object;
			
			if (properties) {
				for (var p in properties) if (OP.hasOwnProperty.call(properties, p)) {
					instance[p] = properties[p];
				}
			}
			
			return instance;
		},
		
		keys : function(o) {
			if (!I.Reflect.isObject(o)) {
				throw new TypeError();
			}
			
			var keys = [];
			for (var p in o) {
				keys.push(p);
			}
			return keys;
		},
		
		hasOwnProperty : function(o, p) {
			return OP.hasOwnProperty.call(o, p);
		},
		
		isPrototypeOf : function(p, o) {
			if (!(I.Reflect.isObject(p) && I.Reflect.isObject(o))) {
				throw new TypeError();
			}
			
			return o.constructor.prototype === p; 
		},
		
		forEachOwnProperty : function(o, f, t) {
			if (typeof t == "undefined") {
				t = I.K.global();
			};
			
			for (var k in o) {
				if (Obj.hasOwnProperty(o, k)) {
					f.call(t, k, o);
				}
			}
		}
	};
});

})(k90tools);


